fix: remove install directory for version when install fails#2024
Conversation
| installScript := filepath.Join(conf.DataDir, "plugins", plugin.Name, "bin", "install") | ||
| f, err := os.OpenFile(installScript, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0777) | ||
| assert.Nil(t, err) | ||
| _, err = f.WriteString("\nexit 1") |
There was a problem hiding this comment.
I thought shebangs were required here. I guess they aren't since the file is run with Bash either way. I wonder if we should include shebangs in the test in case we choose to run them a different way. I imagine we might want to support other scripts besides Bash in the future.
There was a problem hiding this comment.
This is a bit of a hack in that it's appending this content to the end of the existing install script. I didn't think it was worth making a whole separate fixture for, so went with this approach to get it to "fail".
Stratus3D
left a comment
There was a problem hiding this comment.
Thank you for fixing this @andrecloutier ! I've been meaning to fix this but I've been in the process of moving to a new laptop and haven't been able to get tests running yet.
Summary
PR based on feedback in #2008 . This PR will remove the install directory for the given version if it fails to install (install command returns a non-zero exit code).
Fixes: #1981
Fixes: #1940
Other Information